package com.example.com.skills_utf8;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.app.IFlytek;
import com.app.util.Utils;
import com.iflytek.autoupdate.IFlytekUpdate;
import com.iflytek.autoupdate.IFlytekUpdateListener;
import com.iflytek.autoupdate.UpdateErrorCode;
import com.iflytek.autoupdate.UpdateInfo;
import com.iflytek.autoupdate.UpdateType;

public class _74Activity extends AppCompatActivity {
    _74Activity activity = this;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity__74);


        IFlytek.onCreate_init(this, new IFlytekUpdateListener() {
            @Override
            public void onResult(int errorcode, UpdateInfo result) {

                IFlytekUpdate updManager = IFlytekUpdate.getInstance(activity);
                if(errorcode == UpdateErrorCode.OK && result!= null) {
                    if(result.getUpdateType() == UpdateType.NoNeed) {
                        Utils.ToastUI(activity, "已经是最新版本！");
                        return;
                    }
                    updManager.showUpdateInfo(activity, result);
                }
                else
                {
                    Utils.ToastUI(activity, "请求更新失败！\n更新错误码：" + errorcode);
                }

            }
        });

    }
}
